Attributes of <c:set>
Name |
Description |
Type |
Required |
---|---|---|---|
var |
Name of the variable to store the value |
String |
False |
value |
Expression to be evaluated |
String |
False |
target |
Target Object whose object is set. Must evaluate to a JavaBean with setter or java.util.Map Object |
String |
False |
property |
Name of the property to be set in the target object. |
String |
False |
scope |
Scope of the variable. Default is page scope |
String |
False |
JSTL Core Tag
The <c:set> tag is used for variable creation and assignment in JSP pages. In this article, we will delve into the JSTL Core <c:set> tag, provide code samples, and illustrate the expected outputs. It is used to set the result of an expression evaluated in a “scope”.
Prerequisite of the topic
- Good understanding of Java EE web project developments like setting up a servlet or a JSP page with the help of any IDE
- Any IDE with support for Java EE development.
- An installation of Apache Tomcat web server or any other server that supports running Java-based web applications like GlassFish, Websphere, etc.
Syntax
<c:set var="string" value="string" target="string" property="string> scope="string"/>